package com.ruoyi.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 商品分类对象 product_category
 *
 * @author dam
 * @date 2023-07-11
 */
@Data
public class ProductCategory {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 逻辑删除 0：未删除 1：已删除
     */
    @Excel(name = "逻辑删除 0：未删除 1：已删除")
    @TableLogic
    @TableField("is_deleted")
    private Long isDeleted;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 分类名称
     */
    @Excel(name = "分类名称")
    private String name;

    /**
     * 父类id（没有父，值为-1）
     */
    @Excel(name = "父类id", readConverterExp = "没=有父，值为-1")
    private Long parentId;

    /**
     * 图标
     */
    @Excel(name = "图标")
    private String icon;

    /**
     * 排序
     */
    @Excel(name = "排序")
    private Long sort;

    /**
     * 描述
     */
    @Excel(name = "描述")
    private String description;

    private Integer status;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("isDeleted", getIsDeleted())
                .append("name", getName())
                .append("parentId", getParentId())
                .append("icon", getIcon())
                .append("sort", getSort())
                .append("description", getDescription())
                .toString();
    }
}
